<template>
	<view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url:''
			}
		},
		methods: {
			queryUrl(name){
				var _search = this.url.split('?')[1];
				var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)");
				    var r=_search.match(reg);
				    if(r!=null) {
				    	return decodeURIComponent(r[2]); 
				    } else {
				    	return null;
				    }
			}
		},
		onLoad(e){
			this.url =  decodeURIComponent(e.q);
			var _page = this.queryUrl('page');
			var _id = this.queryUrl('id');
			var _share = this.queryUrl('share');
			uni.setStorageSync('share_id',_share);
			uni.setStorageSync('time_tem',(new Date()).getTime());
			if(_page=='goods'){
				uni.setStorageSync('goods_id',_id);
				uni.setStorageSync('note_id',0);
				uni.redirectTo({
				    url: '../local-store-item/local-store-item?id='+_id+'&share='+_share
				});
			}else if(_page=='note'){
				uni.setStorageSync('goods_id',0);
				uni.setStorageSync('note_id',_id);
				uni.redirectTo({
				    url: '../share-details/share-details?id='+_id+'&share='+_share
				});
			}else{
				uni.redirectTo({
				    url: '../index/index'
				});
			}
		}
	}
</script>

<style>

</style>
